package com.library.entity;

import java.io.Serializable;

/**
 * 用户实体类
 */
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private int id;             // 用户ID
    private String username;    // 用户名
    private String password;    // 密码
    private String realName;    // 真实姓名
    private String email;       // 邮箱
    private String phone;       // 电话
    private int role;           // 角色：0-管理员，1-普通用户
    private String registerTime; // 注册时间
    
    // 无参构造函数
    public User() {
    }
    
    // 有参构造函数
    public User(String username, String password, String realName, String email, 
                String phone, int role) {
        this.username = username;
        this.password = password;
        this.realName = realName;
        this.email = email;
        this.phone = phone;
        this.role = role;
    }
    
    // Getter和Setter方法
    public int getId() {
        return id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    public String getUsername() {
        return username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public String getRealName() {
        return realName;
    }
    
    public void setRealName(String realName) {
        this.realName = realName;
    }
    
    public String getEmail() {
        return email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    public int getRole() {
        return role;
    }
    
    public void setRole(int role) {
        this.role = role;
    }
    
    public String getRegisterTime() {
        return registerTime;
    }
    
    public void setRegisterTime(String registerTime) {
        this.registerTime = registerTime;
    }
    
    @Override
    public String toString() {
        return "User [id=" + id + ", username=" + username + ", password=" + password 
                + ", realName=" + realName + ", email=" + email + ", phone=" + phone 
                + ", role=" + role + ", registerTime=" + registerTime + "]";
    }
}
